package com.boardgame.gwt.data.tile.hazard;

import com.boardgame.gwt.data.GwtGameBoard;
import com.boardgame.gwt.data.space.GwtSpace;
import com.boardgame.gwt.data.tile.GwtSpaceTile;

/**
 * 水灾难
 */
public class GwtSpaceTileHazardFlood extends GwtSpaceTileHazard {
    public GwtSpaceTileHazardFlood(){
        this.setInfo("flood");
        this.setVpoints(3);
    }

    @Override
    public void addTileToMapSpace(GwtGameBoard gwtGameBoard) {
        for (int i=0;i<4;i++){
            //是否为空
            GwtSpace gwtSpace = gwtGameBoard.getGwtSplace(0,i);
            if (gwtSpace.getGwtSpaceTile()==null){
                gwtSpace.setGwtSpaceTile(this);
                return;
            }
        }
    }
}
